home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: 500 MB Amiga Software / 500 MB Amiga Software - Euber 130 - Amiga Games Disc & Mag.iso / userbox / publicdomain / shellbench / shellbench.install < prev    next >
Text File  |  1995-04-30  |  9KB  |  385 lines

  1. ; *************************************************************************
  2. ; *******************  SHELLBENCH INSTALLATION SCRIPT  ********************
  3. ; *************************************************************************
  4. ;
  5. ; $VER: InstallShellBench 1.0 (30.4.95)
  6. ;
  7. ; Copyright ©1995 Nick Christie
  8. ;
  9. ; *************************************************************************
  10. ;
  11. ; Find out about program version, etc
  12.  
  13. ; get version of SB in distribution
  14. (set vernum-sb (getversion "ShellBench"))
  15. (set ver-sb    (/ vernum-sb 65536))
  16. (set rev-sb    (- vernum-sb (* ver-sb 65536) ) )
  17.  
  18. (set @default-dest "")
  19. (set defsbdir "SYS:WBStartup")
  20. (set libsdir "Libs:")
  21. (set catsdir "Locale:Catalogs")
  22.  
  23. ; if novice user-level, bump up to average
  24. (if (= 0 @user-level)
  25.     (
  26.     (set @user-level 1)
  27.     (user 1)
  28.     )
  29. )
  30.  
  31. (set old-user-level @user-level)
  32.  
  33. ; ************************************************************************
  34. ; English strings
  35. ; ************************************************************************
  36.  
  37. (set default_lang 4)
  38.  
  39. (set #yes-msg "Yes")
  40.  
  41. (set #no-msg "No")
  42.  
  43. (set #bad-kick-msg "ShellBench requires AmigaOS 2.04 or better!")
  44.  
  45. (set #hello-msg
  46.     (cat
  47.         ("Welcome to ShellBench V%ld.%ld\n\n" ver-sb rev-sb)
  48.         "This script will install ShellBench and "
  49.         "related files on your Amiga.\n\n"
  50.         "You will need to answer a few questions such as "
  51.         "where you would like the program installed.\n\n"
  52.         "If you do not wish to install ShellBench at this time, "
  53.         "select the 'Abort Install' button now. "
  54.     )
  55. )
  56.  
  57. (set #sb-askdir-msg "Please select the directory to install ShellBench in.")
  58.  
  59. (set #keepicon-msg "Do you wish to keep your existing ShellBench icon?")
  60.  
  61. (set #keepicon-help
  62.     (cat
  63.         "If you select 'Yes', your existing ShellBench icon will not "
  64.         "be overwritten. If you select 'No', a new icon for ShellBench "
  65.         "will be installed."
  66.     )
  67. )
  68.  
  69. (set #bgui-askdir-msg
  70.     (cat
  71.         "Select the directory to install bgui.library in. "
  72.         "(Will *not* overwrite any existing newer version.)"
  73.     )
  74. )
  75.  
  76. (set #sbguide "ShellBench.guide")
  77.  
  78. (set #sbguide-ask-msg
  79.     (cat
  80.         "\nInstall ShellBench documentation?\n\n"
  81.         "(This is an AmigaGuide file, and you will be asked "
  82.         "for the directory in which to install it.)\n\n"
  83.         "I recommend installing this, and reading it too, "
  84.         "so that you know how to utilitise ShellBench to "
  85.         "its fullest."
  86.     )
  87. )
  88.  
  89. (set #sbguide-askdir-msg
  90.     (cat
  91.         "\nPlease select the directory "
  92.         "to install ShellBench.guide in.\n"
  93.     )
  94. )
  95.  
  96. (set #guide-help
  97.     (cat
  98.         "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  99.         "If you have AmigaOS 3.0 or better, you can use MultiView "
  100.         "to read this documentation, otherwise you must use the AmigaGuide "
  101.         "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  102.         "Both of these viewer programs have a 'search path', a set "
  103.         "of directories they search for AmigaGuide documents. "
  104.         "You should place this guide somewhere in that path."
  105.     )
  106. )
  107.  
  108. (set #locale-msg
  109.     (cat
  110.         "\nShellBench is localized, which means you may use "
  111.         "the program in several different languages. "
  112.         "Please choose your preferred languages.\n"
  113.     )
  114. )
  115.  
  116. (set #locale-help
  117.     (cat
  118.         "These are the languages supported by ShellBench.\n\n"
  119.         "Simply specify the languages you prefer and the "
  120.         "required catalog files will be copied to the "
  121.         "Locale:Catalogs directory.\n\nThis feature is "
  122.         "only available under AmigaOS 2.1 and later."
  123.     )
  124. )
  125.  
  126. ; ************************************************************************
  127. ; xxxx strings - template for other languages
  128. ; ************************************************************************
  129.  
  130. (if (= @language "xxxx")
  131.     (
  132.     (set default_lang 4)
  133.  
  134.     (set #yes-msg "Yes")
  135.  
  136.     (set #no-msg "No")
  137.  
  138.     (set #bad-kick-msg "ShellBench requires AmigaOS 2.04 or better!")
  139.  
  140.     (set #hello-msg
  141.         (cat
  142.             ("Welcome to ShellBench V%ld.%ld\n\n" ver-sb rev-sb)
  143.             "This script will install ShellBench and "
  144.             "related files on your Amiga.\n\n"
  145.             "You will need to answer a few questions such as "
  146.             "where you would like the program installed.\n\n"
  147.             "If you do not wish to install ShellBench at this time, "
  148.             "select the 'Abort Install' button now. "
  149.         )
  150.     )
  151.  
  152.     (set #sb-askdir-msg "Please select the directory to install ShellBench in.")
  153.  
  154.     (set #keepicon-msg "Do you wish to keep your existing ShellBench icon?")
  155.  
  156.     (set #keepicon-help
  157.         (cat
  158.             "If you select 'Yes', your existing ShellBench icon will not "
  159.             "be overwritten. If you select 'No', a new icon for ShellBench "
  160.             "will be installed."
  161.         )
  162.     )
  163.  
  164.     (set #bgui-askdir-msg
  165.         (cat
  166.             "Select the directory to install bgui.library in. "
  167.             "(Will *not* overwrite any existing newer version.)"
  168.         )
  169.     )
  170.  
  171.     (set #sbguide "/Guides/xxxx/ShellBench.guide")
  172.  
  173.     (set #sbguide-ask-msg
  174.         (cat
  175.             "\nInstall ShellBench documentation?\n\n"
  176.             "(This is an AmigaGuide file, and you will be asked "
  177.             "for the directory in which to install it.)\n\n"
  178.             "I recommend installing this, and reading it too, "
  179.             "so that you know how to utilitise ShellBench to "
  180.             "its fullest."
  181.         )
  182.     )
  183.  
  184.     (set #sbguide-askdir-msg
  185.         (cat
  186.             "\nPlease select the directory "
  187.             "to install ShellBench.guide in.\n"
  188.         )
  189.     )
  190.  
  191.     (set #guide-help
  192.         (cat
  193.             "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  194.             "If you have AmigaOS 3.0 or better, you can use MultiView "
  195.             "to read this documentation, otherwise you must use the AmigaGuide "
  196.             "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  197.             "Both of these viewer programs have a 'search path', a set "
  198.             "of directories they search for AmigaGuide documents. "
  199.             "You should place this guide somewhere in that path."
  200.         )
  201.     )
  202.  
  203.     (set #locale-msg
  204.         (cat
  205.             "\nShellBench is localized, which means you may use "
  206.             "the program in several different languages. "
  207.             "Please choose your preferred languages.\n"
  208.         )
  209.     )
  210.  
  211.     (set #locale-help
  212.         (cat
  213.             "These are the languages supported by ShellBench.\n\n"
  214.             "Simply specify the languages you prefer and the "
  215.             "required catalog files will be copied to the "
  216.             "Locale:Catalogs directory.\n\nThis feature is "
  217.             "only available under AmigaOS 2.1 and later."
  218.         )
  219.     )
  220.     ) ; endif xxxx language
  221. )
  222.  
  223. ; ************************************************************************
  224. ; Begin actual installation
  225. ; ************************************************************************
  226.  
  227. ; Check for KickV37 or better
  228.  
  229. (if (< (/ (getversion) 65536) 37)
  230.     (
  231.     (abort #bad-kick-msg)
  232.     )
  233. )
  234.  
  235. ; ------------------------------------------------------------------------
  236. ; Show welcome msg
  237.  
  238. (user 2)
  239. (message #hello-msg)
  240. (user old-user-level)
  241.  
  242. ; ------------------------------------------------------------------------
  243. ; Ask the user where we should install ShellBench.
  244.  
  245. (set sbdir
  246.     (askdir
  247.         (prompt #sb-askdir-msg)
  248.         (help @askdir-help)
  249.         (default defsbdir)
  250.     )
  251. )
  252.  
  253. ; ------------------------------------------------------------------------
  254. ; If there is an icon for ShellBench there already, ask the user if we
  255. ; should keep it. If yes then copy just the program, else copy both
  256. ; the program and icon.
  257.  
  258. (if (exists (tackon sbdir "ShellBench.info"))
  259.     ; then
  260.     (if (askbool
  261.             (prompt #keepicon-msg)
  262.             (choices #yes-msg #no-msg)
  263.             (help #keepicon-help)
  264.             (default 1)
  265.         )
  266.         ; then
  267.         (copyfiles (source "ShellBench") (dest sbdir) )
  268.         ; else
  269.         (copyfiles (source "ShellBench") (dest sbdir) (infos) )
  270.     )
  271.     ; else no info there
  272.     (copyfiles (source "ShellBench") (dest sbdir) (infos) )
  273. )
  274.  
  275. (set @default-dest sbdir)
  276.  
  277. ; ------------------------------------------------------------------------
  278. ; Install BGUI library. If expert, ask for directory.
  279.  
  280. (if (= 2 @user-level)
  281.     (set libsdir
  282.         (askdir
  283.             (prompt #bgui-askdir-msg)
  284.             (help @askdir-help)
  285.             (default libsdir)
  286.         )
  287.     )
  288. )
  289.  
  290. (copylib (source "Libs/bgui.library") (dest libsdir)
  291. )
  292.  
  293. ; ------------------------------------------------------------------------
  294. ; Install ShellBench.guide. Ask yes/no first, then ask for directory.
  295. ; If installed, set GUIDEFILE tooltype of ShellBench.
  296.  
  297. (set guidedir sbdir)
  298.  
  299. (if (askbool
  300.         (prompt #sbguide-ask-msg)
  301.         (help #guide-help)
  302.         (default 1)
  303.         (choices #yes-msg #no-msg)
  304.     )
  305.     ; then
  306.     (
  307.     (set guidedir
  308.         (askdir
  309.             (prompt #sbguide-askdir-msg)
  310.             (help @askdir-help)
  311.             (default guidedir)
  312.         )
  313.     )
  314.     (copyfiles (source #sbguide) (dest guidedir) (infos) )
  315.     (tooltype
  316.         (dest (tackon sbdir "ShellBench"))
  317.         (settooltype "GUIDEFILE" (tackon guidedir "ShellBench.guide"))
  318.     )
  319.     )
  320. )
  321.  
  322. ;------------------------------------------------------------------------
  323. ; install catalog(s) - none available yet
  324. ;
  325. ;(if (exists "libs:locale.library")
  326. ;    (
  327. ;    (if (exists catsdir)
  328. ;        (
  329. ;        (user 2)     
  330. ;        (set lang
  331. ;            (askoptions
  332. ;                (prompt #locale-msg)
  333. ;                (help #locale-help)
  334. ;                (choices
  335. ;                    "Dansk"
  336. ;                    "Deutsch"
  337. ;                    "English"
  338. ;                    "Español"
  339. ;                    "Français"
  340. ;                    "Italiano"
  341. ;                    "Svenska"
  342. ;                )
  343. ;                (default default_lang)
  344. ;            )
  345. ;        )
  346. ;        (user old-user-level)
  347. ;        (set n 0)
  348. ;        (while
  349. ;            (set language
  350. ;                (select n
  351. ;                    "dansk"
  352. ;                    "deutsch"
  353. ;                    "english"
  354. ;                    "español"
  355. ;                    "français"
  356. ;                    "italiano"
  357. ;                    "svenska"
  358. ;                    ""
  359. ;                )
  360. ;            )
  361. ;            (
  362. ;                (if (in lang n)
  363. ;                    (
  364. ;                    (if (<> 2 n)
  365. ;                        (
  366. ;                        (makedir (cat catsdir "/" language))
  367. ;                        (copyfiles
  368. ;                            (source (cat "Catalogs/" language))
  369. ;                            (dest (cat catsdir "/" language))
  370. ;                            (all)
  371. ;                        )
  372. ;                        )
  373. ;                    )
  374. ;                    )
  375. ;                )
  376. ;                (set n (+ n 1))
  377. ;            )
  378. ;        ) ; endwhile pick language n
  379. ;        ) ; endthen
  380. ;    ) ; endif exists catsdir
  381. ;    ) ; endthen
  382. ;
  383. ;) ; endif exists locale lib
  384.  
  385.